import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app';
import user from './modules/user';
import createPersistedState from 'vuex-persistedstate';

Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [createPersistedState()],
  getters: {
    sidebar: state => state.app.sidebar,
    account: state => state.user.account,
    username: state => state.user.username,
    type: state => state.user.type,
    token: state => state.user.token,

  },
  modules: {
    app, user
  }
})